From 3ad3161f356752a24df51079e5b5d306319c8662 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Sun, 6 Nov 2022 20:33:03 +0100 Subject: overrode requests' 'educated' encoding guesses --- .gitignore | 1 + gather.py | 1 + 2 files changed, 2 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..65eef93 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +db diff --git a/gather.py b/gather.py index 2507311..77c6521 100755 --- a/gather.py +++ b/gather.py @@ -80,6 +80,7 @@ try: logger.info(f"continuing from latest {borrow}") acsm_id = borrow.id+1 r = requests.get(f"https://www.biblos.si/izposoja/prenesi/{acsm_id}.acsm", headers={"User-Agent": f"python-requests/{requests.__version__} (biblos-stat acsm scraper, contact operator: {operator_contact})"}) + r.encoding = "UTF-8" if (r.status_code == 200): failed_acsms_not200_in_a_row = 0 if r.status_code != 200: -- cgit v1.2.3